User blog:GimmeMoreCoinz/Code Update
Hey everyone! Guess what! I'm updating the code for super smash bros V1.1 to V1.2 The codebase for the new game code is incomplete. Here is a sneak peak at the game code if your curious. This code SHOULD work inside petit computer if your avid enough to try it but it won't be smash bros at all . It's full of semi-empty subrouties! Hahaha. Anyways.. I've basically redone the structure of petit smash bros so that it's easier to follow and modify. You'll notice I use alot of arrays and variables that point to other arrays or variables. I'm planning to make it so that I don't even have to think about the filenames for characters down the road, just their number. Anyways. Here it is in all it's glory *cough* ugglyness gosub @setup @main_menu @draw_menu acls locate 20, 0 print " " print "----PETIT SMASH BROS V1.2 ----" print " -" print "| 2013 by GimmeMoreCoinz |" print "| ~Use Up or Down to pick ~ |" print "| |" print "| |" print "| |" print "| |" print "---------------------------------------------------" locate cursor_x, cursor_Y print "up/down "+cursor_text$(cursor_option) locate cursor_x, cursor_y+20 print "Press Start to choose this option" B=button() if B 1024 and cursor_option 1 then gosub @Options if B 1024 and cursor_option 2 then gosub @Singleplayer if B 1024 and cursor_option 3 then gosub @Training if B 1024 and cursor_option 4 then gosub @Adventure if B 1024 and cursor_option 5 then gosub @Gallery return @setup Player_x=0 'the player's X coordinate player_y=0 'the player's Y coordinate Camera_X=0 'offsets in 8 pixels (one tile) per scroll Camera_y=0 'offsets in 8 pixels (one tile) per scroll player_spritenum=null 'is that a constant in this? dim character_names$(4) character_names$(1)="Mario" character_names$(2)="Link" dim linkspriteS$(2) linksprites$(1)="Lruns1_p" 'the first four frames of link's run cycle linksprites$(2)="Lruns2_p" 'the second four frames of link's run cycle dim mariosprites$(2) mariosprites$(1)="MRUNS_" mariosprites$(2)="MPUNCHU" dim charpalletes$(4) 'one for link, one for mario, and two more for the other two characters charpalletes$(1)="thispal" 'mario's punching pallete charpalletes$(2)="Linkbgco" 'link's pallete for running dim charactersizes(4, 2) ' Four characters, one size for their X and one size for their Y charactersizes(1, 1)=16 'Mario's X_size is 16 charactersizes(1, 2)=32 'Mario's Y_size is 32 charactersizes(2, 1)=64 'Link's X_size is 64 charactersizes(2, 2)=64 'Link's y_size is 64 dim cursor_text$(5) cursor_text$(1)="Options" cursor_text$(2)="Single Player cursor_text$(3)="Training" cursor_text$(4)="Adventure" cursor_text$(5)="Gallery" dim npc_variables(3, 25) ''25 npc variables dim npc_physics(3, 4) 'since ptc allows for negative numbers I dont have to worry too much 'three npc's four physics values '1 is if their landed or not '2 is if their falling or not '3 is their X velocity with knockback and can be + or - '4 is their y velocity with knockback and can be + or - '1=npc_x ; 2=npc_y ; 3=npc_playernumber ;4=npc_control number ; 5=npc map_x ; 6=npc map_y '7=npc_damage_percent ; 8=npc_status ; 9=npc_ai_mode ; 10=npc_held_item ; 11=npc_current_frame '12=npc_chr_num ; 13=npc_pallete ; 14=npc_knockback ; 15=npc_level ; 16=npc_damage_ratio '17=npc_knockback_resist ; 18=npc_pose ; 19=npc_fallspeed ; 20=npc_recover_time '21=npc_pokeball set only if has pokeball '22=npc_on_screen '23=npc_scale ' for scaling and rendering the npc to offscreen slowly or foreground '24=npc_sprite_priority 'the system will have a sprite priority i'm assuming ptc draws one sprite over another '25=reserved //this is reserved. don't ask why. It's just a good idea. 'NPC_Control numbers will ALWAYS be from 5 to 9. That's four npcs in total. npc_variables(1, 4)=5 'NPC 1 is control number 5 npc_variables(2, 4)=6 'NPC 2 is control number 6 npc_variables(3, 4)=7 'NPC 3 is control number 7 npc_variableS(4, 4)=8 'NPC 4 is control number 8 cursor_y=6*8 cursor_x=25 cursor_option=1 current_stage=0 'no stage selected! this is important ' stage data is unused = dim stage_data(3, 5) ''five values for stage data '1 is stage_size_X '2 is stage_size_y '3 stage_bg_file ' dim stage_bgs$(5) dim stage_cols$(5) dim stage_names$(5) stage_bgs$(1)="YOSHI_BG" stage_names$(1)="Yoshi's Bridge" stage_cols$(1)="YOSHPAL" 'just a note . some custom collision detection will 'be needed 'i'm not using offsets return @set_npc_values npc_variables(npc_select, 1)=npc_x npc_variables(npc_select, 2)=npc_y npc_variables(npc_select, 3)=npc_playernumber npc_variables(npc_select, 4)=npc_controlnumber npc_variables(npc_select, 5)=npc_map_x npc_variableS(npc_select, 6)=npc_map_y npc_variableS(npc_select, 7)=npc_damage_percent npc_variableS(npc_select, 8)=npc_status npc_variableS(npc_select, 9)=npc_ai_mode npc_variableS(npc_select, 10)=10=npc_held_item npc_variableS(npc_select, 11)=npc_current_frame npc_variableS(npc_select, 12)=12=npc_chr_num npc_variableS(npc_select, 13)=npc_pallete npc_variableS(npc_select, 14)=npc_knockback npc_variableS(npc_select, 15)=npc_level npc_variableS(npc_select, 16)=npc_damage_ratio npc_variableS(npc_select, 17)=npc_knockback_resist npc_variableS(npc_select, 18)=npc_pose npc_variableS(npc_select, 19)npc_fallspeed npc_variableS(npc_select, 20)=npc_recover_time npc_variableS(npc_select, 21)=npc_pokeball npc_variableS(npc_select, 22)=npc_on_screen npc_variableS(npc_select, 23)=npc_scale npc_variableS(npc_select, 24)=npc_sprite_priority return @load_npc_values npc_x=npc_variables(npc_select, 1) npc_y=npc_variables(npc_select, 2) npc_playernumber=npc_variables(npc_select, 3) npc_control number=npc_variables(npc_select, 4) npc_map_x=npc_variables(npc_select, 5) npc_map_y=npc_variableS(npc_select, 6) npc_damage_percent=npc_variableS(npc_select, 7) npc_status=npc_variableS(npc_select, 8) npc_ai_mode =npc_variableS(npc_select, 9) npc_held_item=npc_variableS(npc_select, 10) npc_current_frame=npc_variableS(npc_select, 11) npc_chr_num=npc_variableS(npc_select, 12) npc_pallete=npc_variableS(npc_select, 13) npc_knockback=npc_variableS(npc_select, 14) npc_level=npc_variableS(npc_select, 15) npc_damage_ratio=npc_variableS(npc_select, 16) npc_knockback_resist=npc_variableS(npc_select, 17) npc_pose=npc_variableS(npc_select, 18) npc_fallspeed=npc_variableS(npc_select, 19) npc_recover_time=npc_variableS(npc_select, 20) npc_pokeball=npc_variableS(npc_select, 21) npc_on_screen=npc_variableS(npc_select, 22) npc_scale=npc_variableS(npc_select, 23) npc_sprite_priority=npc_variableS(npc_select, 24) return @Options return @Singleplayer return @Training return @Gallery return @draw_stage return Category:Blog posts